home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Java / SlideShow / Source Clippings / Controller / Controller button actions / Controller button actions.rsrc / TEXT_256.txt < prev   
Encoding:
Text File  |  2000-09-28  |  833 b   |  37 lines

  1.     void backwardButton1_ActionPerformed(ActionEvent event)
  2.     {
  3.         fireActionEvent(BACKWARD_COMMAND);
  4.     }
  5.  
  6.     void forwardButton1_ActionPerformed(ActionEvent event)
  7.     {
  8.         fireActionEvent(FORWARD_COMMAND);
  9.     }
  10.  
  11.     void playPauseButton1_ActionPerformed(ActionEvent event)
  12.     {
  13.         String command = event.getActionCommand();
  14.         try
  15.         {
  16.             int state = Integer.valueOf(command).intValue();
  17.             switch (state)
  18.             {
  19.                 case PlayPauseButton.PLAY_STATE:
  20.                     fireActionEvent(PLAY_COMMAND);
  21.                     playPauseButton1.setState(PlayPauseButton.PAUSE_STATE);
  22.                     break;
  23.                 case PlayPauseButton.PAUSE_STATE:
  24.                     fireActionEvent(PAUSE_COMMAND);
  25.                     playPauseButton1.setState(PlayPauseButton.PLAY_STATE);
  26.                     break;
  27.             }
  28.         }
  29.         catch(NumberFormatException exc) { }
  30.     }
  31.  
  32.     void closeBoxButton1_ActionPerformed(ActionEvent event)
  33.     {
  34.         setVisible(false);
  35.         dispose();
  36.     }
  37.